<?php
include_once( "common.php" );
checkLogin( STATUS_ADMIN );

# Verify the project
if ( ! isValidEntry( "Project", $_GET["id"] ) )
    outputAlert( "Invalid input", "You have entered invalid input." );

outputHeader();

# Fetch information about the project
$result = db_query( "SELECT * FROM Project WHERE id = {$_GET["id"]}" );
$row = db_fetch_object( $result );

print <<<EOF
<div class = "header">Edit project</div>
<form action = "editProject.php" method = "post">
<input type = "hidden" name = "id" value = "{$_GET["id"]}" />
<table style = "width:600px;">
<tr>
<td>Project</td><td><input type = "text" name = "project" value = "{$row->name}" /></td>
</tr>
<tr>
<td>Delete</td><td><input type = "checkbox" name = "delete[]" value = "delete" />Delete project</td>
<td></td><td><input type = "checkbox" name = "delete[]" value = "confirm" />Confirm deletion</td>
</tr>
<tr><td></td><td><input type = "submit" value = "Update project" /></td></tr>
</table>
</form>

EOF;

outputFooter();
?>
